<template>
  <div class="dashboard-container">
    <el-calendar v-model="value" />
    <div class="dashboard-text">name: {{ $store.state.user.username }}</div>
    <button @click="btnClick">修改username</button>
    <Test />
    <Xxx />
    <Abc :num="5" :obj="{ a: 1 }" />
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  data() {
    return {
      value: new Date()
    }
  },
  computed: {},
  created() {
    // console.log('$route', this.$route)
  },
  methods: {
    btnClick() {
      this.$store.commit('user/setUserName', Math.random() * 999)
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
